import { IRoute } from 'umi';
const routes: IRoute[] = [
  {
    path: '/home',
    component: '@/pages/index',
    name: 'layout',
    routes: [
      {
        path: '/home/index',
        component: '@/pages/home',
        name: '首页',
        loading: true,
      },
      {
        path: '/home/myJob',
        component: '@/pages/myJob',
        name: '我的排班',
        loading: true,
      },
      {
        path: '/home/Detail',
        component: '@/pages/calendar',
        loading: true,
        name: '我的排班详情',
      },
      //组织管理
      {
        path: '/home/management',
        // component: '@/pages/management',
        name: '组织管理',
        loading: true,
        routes: [
          {
            path: '/home/management/roomManage',
            component: '@/pages/roomManage',
            name: '组织机构管理',
            loading: true,
          },
          {
            path: '/home/management/userManage',
            component: '@/pages/userManage',
            name: '员工管理',
            loading: true,
          },
          {
            path: '/home/management/roomManage/addOrganization',
            component: '@/pages/addOrganization',
            name: 'addOrganization',
            loading: true,
          },
        ],
      },
      //排班管理
      {
        path: '/home/scheduling',
        name: '排班管理',
        loading: true,
        routes: [
          {
            path: '/home/scheduling/condition',
            component: '@/pages/condition',
            name: '规则管理',
            loading: true,
          },
          {
            path: '/home/scheduling/calendar',
            component: '@/pages/dayCalendar',
            name: '班次统计',
            loading: true,
          },
        ],
      },
      //排班基础设置
      {
        path: '/home/basicSetting',
        name: '排班基础设置',
        loading: true,
        routes: [
          {
            path: '/home/basicSetting/dayJob',
            component: '@/pages/dayJob',
            name: '日程管理',
            loading: true,
          },
        ],
      },
      //系统设置
      {
        path: '/home/settingsOS',
        name: '系统设置',
        loading: true,
        routes: [
          {
            path: '/home/settingsOS/roleManage',
            component: '@/pages/roleManage',
            name: '角色管理',
            loading: true,
          },
        ],
      },
    ],
  },

  {
    path: '/',
    redirect: '/home/settingsOS/roleManage',
    // component: '@/pages/index',
    // redirect: '/login',
    component: '@/pages/登录模块/login',
  },
  {
    path: '/login',
    component: '@/pages/登录模块/login',
  },
  {
    path: '/index',
    component: '@/pages/index.tsx',
    routes: [{}],
  },
  {
    path: '/echarts',
    component: '@/pages/echarts/Echarts',
  },
  {
    path: '/login',
    component: '@/pages/登录模块/login',
  },
];

export default routes;
